//
//  ViewController.swift
//  Art
//
//  Created by mac on 2018/9/21.
//  Copyright © 2018年 mac. All rights reserved.
//

import UIKit
import Alamofire
@available(iOS 12.0, *)
class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = UIColor.red
        let model = test.init()
       
//        let output = try? model.prediction(RM: 4, LSTAT: 5, PTRATIO: 6)
//        print(output?.MEDV )
        
//        let output = try? model.prediction(label: 87654)
//        print(output?.message)
//        
//        let output1 = try? model.prediction(label: 5555)
//        print(output1?.message)
//        
//        
//        let output2 = try? model.prediction(label: 1232113)
//        print(output2?.message)
        
      
        requestData()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    func requestData() {
        let parameters:Dictionary = ["day":"2018-01-12","list":"sh601007",]

        Alamofire.request("http://hq.sinajs.cn", parameters: parameters)
            .responseString { response in
                
                print("result==\(response.result)")   // 返回结果，是否成功
                if let jsonValue = response.result.value {
                    print("result==\(jsonValue)")   // 返回结果，是否成功
                    let gpData = Entity()
                    gpData.gpName = ""
                    
                }
        }
        
        
    
    }


}

